using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.RecipeFramework;
using System.ComponentModel.Design;
using Microsoft.Practices.ComponentModel;
using System.Windows.Forms.Design;
using Resources=Microsoft.Practices.RepositoryFactory.Properties.Resources;

namespace Microsoft.Practices.RepositoryFactory.Actions
{
    public class ShowEntLibMessageAction : ConfigurableAction
    {

        #region InputProperties
        private bool hiveExists;

        [Input(Required=true)]
        public bool HiveExists
        {
            get { return hiveExists; }
            set { hiveExists = value; }
        }


        #endregion

        #region ConfigurableAction Implementation
        /// <summary>
        /// See <see cref="M:Microsoft.Practices.RecipeFramework.IAction.Execute"/>.
        /// </summary>
        public override void Execute()
        {
            if(!hiveExists)
            {
                IUIService ui = base.GetService<IUIService>();

                ui.ShowMessage(Resources.EntlibRegistryError);
            }
        }

        /// <summary>
        /// See <see cref="M:Microsoft.Practices.RecipeFramework.IAction.Undo"/>.
        /// </summary>
        public override void Undo()
        {
            //Do Nothing
        } 
        #endregion
    }
}
